curl --request POST \
--url https://api.topsort.com/toptimize/v1/predictions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"metrics": {
"ctr": true
},
"opaqueUserId": "u_9ske45",
"productIds": [
"p_PJbnN",
"p_ojng4"
],
"objectType": [
"listings"
]
}'
{
"objectType": "listings",
"predictions": [
{
"productId": "p_PJbnN",
"ctr": 0.03,
"cvr": 0.06
},
{
"productId": "p_ojng4",
"ctr": 0.056,
"cvr": 0.091
}
]
}
Use the /predictions
endpoint to get contextual predictions of conversion and relevance metrics, which are personalized by user and context.In order to provide predictions, Topsort requires that events are also sent, as a source of information.
curl --request POST \
--url https://api.topsort.com/toptimize/v1/predictions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"metrics": {
"ctr": true
},
"opaqueUserId": "u_9ske45",
"productIds": [
"p_PJbnN",
"p_ojng4"
],
"objectType": [
"listings"
]
}'
{
"objectType": "listings",
"predictions": [
{
"productId": "p_PJbnN",
"ctr": 0.03,
"cvr": 0.06
},
{
"productId": "p_ojng4",
"ctr": 0.056,
"cvr": 0.091
}
]
}
A valid API key generated in Topsort's UI.
⚠️ Beta Access Required Contact your sales representative to gain access to this endpoint and start using it. The context information for the predictions, including which metrics to predict.
The body is of type object
.
The prediction results. This will provide a numerical value for each combination of metric/product requested on the API call.
The response is of type object
.